import Vue from "vue";
import VueRouter from "vue-router";

import AboutCom from '../components/AboutCom';
import HomeCom from '../components/HomeCom';

import HomeMessage from '../components/HomeCom/components/HomeMessage';
import HomeNews from '../components/HomeCom/components/HomeNews';

import DetailCom from '../components/HomeCom/components/HomeMessage/DetailCom';

Vue.use(VueRouter);

export default new VueRouter({
    routes: [
        {
            path: '/home',
            component: HomeCom,
            children: [
                {
                    path: 'message',
                    component: HomeMessage,
                    children: [
                        {
                            path: 'detail/:id',
                            component: DetailCom
                        } 
                    ]
                },
                {
                    path: 'news',
                    component: HomeNews
                }
            ]
        },
        {
            path: '/about',
            component: AboutCom,
            meta: {
                title: '我是meta传来的数据'
            }
        },{
            path: '*',
            redirect: '/Home'
        }
    ]
})